package com.example.demo.config.RabbitMQ;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by Mojo on 2017/9/20.
 */
//@Component //关闭中，启动请删除注释
public class Receiver {

	@RabbitListener(queues = "hello.queue1")
	public String processMessage1(String msg) {
		System.out.println(Thread.currentThread().getName() + " 接收到来自hello.queue1队列的消息：" + msg);
		return msg.toUpperCase();
	}

	@RabbitListener(queues = "hello.queue2")
	public void processMessage2(String msg) {
		System.out.println(Thread.currentThread().getName() + " 接收到来自hello.queue2队列的消息：" + msg);
	}
}
